<template>
    <div>
        <el-form 
        :model="attendance" 
        :rules="rules" ref="attendance" 
        v-loading="go"
        element-loading-text="正在跳转请稍等"
        element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(0, 0, 0, 0.8)" label-width="100px" class="demo-ruleForm">
            <el-row style=" padding-left:30px; padding-top:20px;">
                <el-col :span="24">
                    <div class="grid-content bg-purple-dark">
                        <br>
                        <div class="kuang"></div>
                        <span style="padding-left:40px;" >基本信息</span>
                        <div class="xian"></div>
                        <div class="kuai">
                            <!-- 新增补卡start -->
                                    <el-form-item label="考勤组名称" prop="attendanceName">
                                        <el-input v-model="attendance.attendanceName" placeholder="请输入" style="width:400px;"></el-input>
                                    </el-form-item>
                                <!-- 考勤人员start -->
                                    <el-form-item label="考勤人员" prop="shiftHead">
                                        <div style="background-color: rgba(248, 248, 248, 1);width: 425px;height: 220px;">
                                            <br>
                                            <div  class="avatar-uploader">
                                                <!-- 选中负责人后展示start -->
                                                &nbsp;&nbsp;&nbsp;参与考勤
                                                <div style="display: inline;" v-if="selectedUsers!=''">
                                                    <div  style="display: inline;"  v-for="selectedUser,index in selectedUsers" :key="index">
                                                        <img style="vertical-align: middle;"   :src="selectedUser.icon" class="avatar" @click="getSelectIdPage()">
                                                        <i style="position: relative;bottom: 13px;right: 12px;border-radius: 50%;background-color: #c0c4cc;color: white;" class="el-icon-close" @click="deUser(index)"></i>
                                                    </div>
                                                </div>
                                                <!-- 选中负责人后展示end -->
                                                <!-- 负责人未选中展示 -->
                                                <i v-else @click="getSelectIdPage()" class="el-icon-plus avatar-uploader-icon"></i>
                                            </div>
                                            <br>
                                            <div  class="avatar-uploader">
                                                <!-- 选中负责人后展示start -->
                                                &nbsp;&nbsp;&nbsp;无需考勤
                                                <div style="display: inline;" v-if="unSelectedUsers!=''">
                                                    <div style="display: inline;" v-for="selectedUser,index in unSelectedUsers" :key="index">
                                                        <img style="vertical-align: middle;"   :src="selectedUser.icon" class="avatar" @click="getUnSelectIdPage()">
                                                        <i style="position: relative;bottom: 13px;right: 12px;border-radius: 50%;background-color: #c0c4cc;color: white;" @click="unDeUser(index)" class="el-icon-close"></i>
                                                    </div>
                                                </div>
                                                
                                                <!-- 选中负责人后展示end -->
                                                <!-- 负责人未选中展示 -->
                                                <i v-else @click="getUnSelectIdPage()" class="el-icon-plus avatar-uploader-icon"></i>
                                            </div>
                                        </div>
                                        
                                    </el-form-item>
                                    <!-- 需要考勤 -->
                                    <el-dialog
                                        v-loading="loading"
                                        element-loading-text="拼命加载中"
                                        element-loading-spinner="el-icon-loading"
                                        element-loading-background="rgba(0, 0, 0, 0.8)"
                                        :visible.sync="headPage"
                                        width="50%"
                                        :show-close="false">
                                        <div style="height: 200px;">
                                            <el-breadcrumb separator-class="el-icon-arrow-right">
                                                <!-- 步骤条start -->
                                                <el-breadcrumb-item  v-for="(value,index) in headNavs" :key="index+'E'" @click="upNav(index)">
                                                    <el-button v-if="persons.id==undefined" size="mini" style="border: 0px;" @click="upNav(index)">{{ value }}</el-button>
                                                </el-breadcrumb-item>
                                                <!-- 步骤条end -->
                                                <br>
                                                <br>
                                                <br>
                                                <!-- 展示右边所选中的用户start -->
                                                <div style="float: right;margin-top: -70px;margin-right:30%;color: black;">
                                                    已选择<span v-if="selectedUsers!=''">{{ selectedUsers.length }}</span><span v-else>0</span>位联系人
                                                    <br>
                                                    <br>
                                                    <br>
                                                </div>
                                                <!-- 展示选中的用户 -->
                                                <div v-for="selectedUser,index in selectedUsers" :key="index">
                                                    <div class="architecture" style="height: 50px;position: relative;top: 12px;left: 430px;">
                                                        <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="selectedUser.icon"/>
                                                        <span style="margin-left: 17%;color: black;color: black;font-size: 10px;display: block;margin-top: -20px;">
                                                            {{ selectedUser.nickName }}<br><br>
                                                            {{ selectedUser.tposition.deptName }}
                                                            <span style="float: right;margin-top: -10px;margin-right: 20px;cursor: pointer;" @click="deUser(index)">X</span>
                                                        </span>
                                                    </div>
                                                </div>
                                                
                                                <!-- 展示右边所选中的用户end -->
                                                <!-- 展示左边信息start -->
                                                <!-- 展示部门和人数start -->
                                                <div style="position: absolute; top: 100px;">
                                                    <div class="architecture" style="line-height: 39px;" v-for="(value,perIndex) in persons" :key="perIndex" @click="selectArchitecture(value.deptName)">
                                                        <div class="log">
                                                            <img src="https://cdn7.axureshop.com/demo2023/2236859/images/%E8%AF%B7%E5%81%87/u2303.svg" />
                                                        </div>
                                                        <span style="margin-left: 5%;color: black;">
                                                            {{ value.deptName }}
                                                        </span>
                                                        &nbsp;&nbsp;&nbsp;({{ value.deptCount }})
                                                        <span style="float: right;margin-right: 20px;">
                                                            ＞
                                                        </span>
                                                    </div>
                                                    <!-- 展示部门和人数end -->
                                                    <br>
                                                    <!-- 展示当前所选部门的所有用户start -->
                                                    <div v-if="users.length!=0">
                                                        <el-checkbox-group v-model="selectIds"  @change="selectUser()">
                                                            <div class="architecture" style="height: 50px;"  v-for="(myUser,userIndex) in users" :key="userIndex"   >
                                                                <el-checkbox style="width: 80%;height: 100%;" :label="myUser.id">
                                                                    &nbsp;&nbsp;&nbsp;
                                                                    <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="myUser.icon"/>
                                                                    <span style="margin-left: 5%;color: black;font-size: 10px;float: left;position: relative;top: 12px;left: 110px;">
                                                                        {{ myUser.nickName }}<br>
                                                                        {{ myUser.tposition.deptName }}
                                                                    </span>
                                                                    <span style="margin-top: 25px;margin-left: 120px;">
                                                                        ＞
                                                                    </span>
                                                                </el-checkbox>
                                                            </div>
                                                        </el-checkbox-group>
                                                    </div>
                                                    <!-- 展示当前所选部门的所有用户start -->
                                                    <!-- 展示左边信息end -->

                                                </div>
                                                                                            
                                            </el-breadcrumb>

                                            <!-- 竖直分割线 -->
                                            <div class="myHr"></div>
                                        </div>
                                        <span slot="footer" class="dialog-footer">
                                            <el-button @click="headPage = false">取 消</el-button>
                                            <el-button type="primary" @click="headPage = false">确 定</el-button>

                                        </span>

                                    </el-dialog>

                                    <!-- 无需考勤 -->
                                    <el-dialog
                                        v-loading="loading"
                                        element-loading-text="拼命加载中"
                                        element-loading-spinner="el-icon-loading"
                                        element-loading-background="rgba(0, 0, 0, 0.8)"
                                        :visible.sync="unSelectIdPage"
                                        width="50%"
                                        :show-close="false">
                                        <div style="height: 200px;">
                                            <el-breadcrumb separator-class="el-icon-arrow-right">
                                                <!-- 步骤条start -->
                                                <el-breadcrumb-item  v-for="(value,index) in headNavs" :key="index+'E'" @click="upNav(index)">
                                                    <el-button v-if="persons.id==undefined" size="mini" style="border: 0px;" @click="upNav(index)">{{ value }}</el-button>
                                                </el-breadcrumb-item>
                                                <!-- 步骤条end -->
                                                <br>
                                                <br>
                                                <br>
                                                <!-- 展示右边所选中的用户start -->
                                                <div style="float: right;margin-top: -70px;margin-right:30%;color: black;">
                                                    已选择<span v-if="unSelectedUsers!=''">{{ unSelectedUsers.length }}</span><span v-else>0</span>位联系人
                                                    <br>
                                                    <br>
                                                    <br>
                                                </div>
                                                <!-- 展示选中的用户 -->
                                                <div v-for="selectedUser,index in unSelectedUsers" :key="index">
                                                    <div class="architecture" style="height: 50px;position: relative;top: 12px;left: 430px;">
                                                        <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="selectedUser.icon"/>
                                                        <span style="margin-left: 17%;color: black;color: black;font-size: 10px;display: block;margin-top: -20px;">
                                                            {{ selectedUser.nickName }}<br><br>
                                                            {{ selectedUser.tposition.deptName }}
                                                            <span style="float: right;margin-top: -10px;margin-right: 20px;cursor: pointer;" @click="unDeUser(index)">X</span>
                                                        </span>
                                                    </div>
                                                </div>
                                                
                                                <!-- 展示右边所选中的用户end -->
                                                <!-- 展示左边信息start -->
                                                <!-- 展示部门和人数start -->
                                                <div style="position: absolute; top: 100px;">
                                                    <div class="architecture" style="line-height: 39px;" v-for="(value,perIndex) in persons" :key="perIndex" @click="selectArchitecture(value.deptName)">
                                                        <div class="log">
                                                            <img src="https://cdn7.axureshop.com/demo2023/2236859/images/%E8%AF%B7%E5%81%87/u2303.svg" />
                                                        </div>
                                                        <span style="margin-left: 5%;color: black;">
                                                            {{ value.deptName }}
                                                        </span>
                                                        &nbsp;&nbsp;&nbsp;({{ value.deptCount }})
                                                        <span style="float: right;margin-right: 20px;">
                                                            ＞
                                                        </span>
                                                    </div>
                                                    <!-- 展示部门和人数end -->
                                                    <br>
                                                    <!-- 展示当前所选部门的所有用户start -->
                                                    <div v-if="users.length!=0">
                                                        <el-checkbox-group v-model="unSelectIds"  @change="unSelectUser()">
                                                            <div class="architecture" style="height: 50px;"  v-for="(myUser,userIndex) in users" :key="userIndex"   >
                                                                <el-checkbox style="width: 80%;height: 100%;" :label="myUser.id">
                                                                    &nbsp;&nbsp;&nbsp;
                                                                    <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="myUser.icon"/>
                                                                    <span style="margin-left: 5%;color: black;font-size: 10px;float: left;position: relative;top: 12px;left: 110px;">
                                                                        {{ myUser.nickName }}<br>
                                                                        {{ myUser.tposition.deptName }}
                                                                    </span>
                                                                    <span style="margin-top: 25px;margin-left: 120px;">
                                                                        ＞
                                                                    </span>
                                                                </el-checkbox>
                                                            </div>
                                                        </el-checkbox-group>
                                                    </div>
                                                    <!-- 展示当前所选部门的所有用户start -->
                                                    <!-- 展示左边信息end -->

                                                </div>

                                                                                            
                                            </el-breadcrumb>

                                            <!-- 竖直分割线 -->
                                            <div class="myHr"></div>
                                        </div>
                                        <span slot="footer" class="dialog-footer">
                                            <el-button @click="unSelectIdPage = false">取 消</el-button>
                                            <el-button type="primary" @click="unSelectIdPage = false">确 定</el-button>

                                        </span>

                                    </el-dialog>
                                <!-- 选择考勤人员end -->

                                <!-- 选择负责人start -->
                                    <el-form-item label="考勤负责人" prop="shiftHead">
                                        <div style="background-color: rgba(248, 248, 248, 1);width: 425px;height: 220px;">
                                            <br>
                                            <div style="display: inline;"  class="avatar-uploader">
                                                <!-- 选中主责人后展示start -->
                                                &nbsp;&nbsp;&nbsp;主负责人
                                                <div style="display: inline" v-if="hostSelectedUser!=''" >
                                                    <img style="vertical-align: middle;" :src="hostSelectedUser.icon" class="avatar" @click="getHostHeadPage">
                                                    <i style="position: relative;bottom: 13px;right: 12px;border-radius: 50%;background-color: #c0c4cc;color: white;" @click="hostDeUser()" class="el-icon-close"></i>

                                                </div>
                                                <!-- 选中主责人后展示end -->
                                                <!-- 主责人未选中展示 -->
                                                <i v-else @click="getHostHeadPage" class="el-icon-plus avatar-uploader-icon"></i>
                                            </div>
                                            <br>
                                            <br>
                                            <div  class="avatar-uploader">
                                                <!-- 选中负责人后展示start -->
                                                &nbsp;&nbsp;&nbsp;子负责人
                                                <div style="display: inline;" v-if="childHeadUsers!=''">
                                                    <div style="display: inline;" v-for="selectedUser,index in childHeadUsers" :key="index">
                                                        <img style="vertical-align: middle;"   :src="selectedUser.icon" class="avatar" @click="getchildHeadPage">
                                                        <i style="position: relative;bottom: 13px;right: 12px;border-radius: 50%;background-color: #c0c4cc;color: white;" @click="childHeadDeUser(index)" class="el-icon-close"></i>
                                                    </div>
                                                </div>
                                                
                                                <!-- 选中负责人后展示end -->
                                                <!-- 负责人未选中展示 -->
                                                <i v-else @click="getchildHeadPage" class="el-icon-plus avatar-uploader-icon"></i>
                                            </div>
                                        </div>
                                        
                                    </el-form-item>
                                    <!-- 主负责人 -->
                                    <el-dialog
                                        v-loading="loading"
                                        element-loading-text="拼命加载中"
                                        element-loading-spinner="el-icon-loading"
                                        element-loading-background="rgba(0, 0, 0, 0.8)"
                                        :visible.sync="hostHeadPage"
                                        width="50%"
                                        :show-close="false">
                                        <el-breadcrumb separator-class="el-icon-arrow-right">
                                            <!-- 步骤条start -->
                                            <el-breadcrumb-item  v-for="(value,index) in headNavs" :key="index+'E'" @click="upRadNav(index)">
                                                <el-button v-if="persons.id==undefined" size="mini" style="border: 0px;" @click="upRadNav(index)">{{ value }}</el-button>
                                            </el-breadcrumb-item>
                                            <!-- 步骤条end -->
                                            <br>
                                            <br>
                                            <br>
                                            <!-- 展示右边所选中的用户start -->
                                            <div style="float: right;margin-top: -70px;margin-right:30%;color: black;">
                                                已选择<span v-if="hostSelectedUser!=''">1</span><span v-else>0</span>位联系人
                                                <br>
                                                <br>
                                                <br>
                                            </div>
                                            <!-- 展示选中的用户 -->
                                            <div  v-if="hostSelectedUser!=''" class="architecture" style="height: 50px;float: right;    position: relative;top: 12px;right: 50px;">
                                                <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="hostSelectedUser.icon"/>
                                                <span style="margin-left: 17%;color: black;color: black;font-size: 10px;display: block;margin-top: -20px;">
                                                    {{ hostSelectedUser.nickName }}<br><br>
                                                    {{ hostSelectedUser.tposition.deptName }}
                                                    <span style="float: right;margin-top: -10px;margin-right: 20px;cursor: pointer;" @click="hostDeUser">X</span>
                                                </span>
                                                
                                            </div>
                                            <!-- 展示右边所选中的用户end -->
                                            <!-- 展示左边信息start -->
                                            <!-- 展示部门和人数start -->
                                            <div class="architecture" style="line-height: 39px;" v-for="(value,perIndex) in persons" :key="perIndex" @click="selectArchitecture(value.deptName)">
                                                <div class="log">
                                                    <img src="https://cdn7.axureshop.com/demo2023/2236859/images/%E8%AF%B7%E5%81%87/u2303.svg" />
                                                </div>
                                                <span style="margin-left: 5%;color: black;">
                                                    {{ value.deptName }}
                                                </span>
                                                &nbsp;&nbsp;&nbsp;({{ value.deptCount }})
                                                <span style="float: right;margin-right: 20px;">
                                                    ＞
                                                </span>
                                            </div>
                                            <!-- 展示部门和人数end -->
                                            <br>
                                            <!-- 展示当前所选部门的所有用户start -->
                                            <div v-if="users.length!=0">
                                                <div :class="[selectArchitectureCss != userIndex ?'architecture': '',selectArchitectureCss == userIndex ? 'architectureActe':'']" style="height: 50px;"  v-for="(myUser,userIndex) in users" :key="userIndex" @click="hostSelectUser(userIndex)">
                                                    <el-radio style="width: 80%;height: 100%;" v-model="hostHeadId" :label="userIndex">
                                                        &nbsp;&nbsp;&nbsp;
                                                        <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="myUser.icon"/>
                                                        <span style="margin-left: 5%;color: black;font-size: 10px;float: left;position: relative;top: 12px;left: 110px;">
                                                            {{ myUser.nickName }}<br><br>
                                                            {{ myUser.tposition.deptName }}
                                                        </span>
                                                        
                                                    </el-radio>
                                                    <span>
                                                            ＞
                                                    </span>
                                                </div>
                                            </div>
                                            <!-- 展示当前所选部门的所有用户start -->
                                            <!-- 展示左边信息end -->
                                            
                                        </el-breadcrumb>

                                        <!-- 竖直分割线 -->
                                        <div class="myHr"></div>
                                        
                                       
                                        <span slot="footer" class="dialog-footer">
                                            <el-button @click="hostHeadPage = false">取 消</el-button>
                                            <el-button type="primary" @click="hostHeadPage = false">确 定</el-button>
                                        </span>
                                    </el-dialog>
                                    <!-- 子负责人 -->
                                    <el-dialog
                                        v-loading="loading"
                                        element-loading-text="拼命加载中"
                                        element-loading-spinner="el-icon-loading"
                                        element-loading-background="rgba(0, 0, 0, 0.8)"
                                        :visible.sync="childHeadPage"
                                        width="50%"
                                        :show-close="false">
                                        <div style="height: 200px;">
                                            <el-breadcrumb separator-class="el-icon-arrow-right">
                                                <!-- 步骤条start -->
                                                <el-breadcrumb-item  v-for="(value,index) in headNavs" :key="index+'E'" @click="upNav(index)">
                                                    <el-button v-if="persons.id==undefined" size="mini" style="border: 0px;" @click="upNav(index)">{{ value }}</el-button>
                                                </el-breadcrumb-item>
                                                <!-- 步骤条end -->
                                                <br>
                                                <br>
                                                <br>
                                                <!-- 展示右边所选中的用户start -->
                                                <div style="float: right;margin-top: -70px;margin-right:30%;color: black;">
                                                    已选择<span v-if="childHeadUsers!=''">{{ childHeadUsers.length }}</span><span v-else>0</span>位联系人
                                                    <br>
                                                    <br>
                                                    <br>
                                                </div>
                                                <!-- 展示选中的用户 -->
                                                <div v-for="selectedUser,index in childHeadUsers" :key="index">
                                                    <div class="architecture" style="height: 50px;position: relative;top: 12px;left: 430px;">
                                                        <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="selectedUser.icon"/>
                                                        <span style="margin-left: 17%;color: black;color: black;font-size: 10px;display: block;margin-top: -20px;">
                                                            {{ selectedUser.nickName }}<br><br>
                                                            {{ selectedUser.tposition.deptName }}
                                                            <span style="float: right;margin-top: -10px;margin-right: 20px;cursor: pointer;" @click="childHeadDeUser(index)">X</span>
                                                        </span>
                                                    </div>
                                                </div>
                                                
                                                <!-- 展示右边所选中的用户end -->
                                                <!-- 展示左边信息start -->
                                                <!-- 展示部门和人数start -->
                                                <div style="position: absolute; top: 100px;">
                                                    <div class="architecture" style="line-height: 39px;" v-for="(value,perIndex) in persons" :key="perIndex" @click="selectArchitecture(value.deptName)">
                                                        <div class="log">
                                                            <img src="https://cdn7.axureshop.com/demo2023/2236859/images/%E8%AF%B7%E5%81%87/u2303.svg" />
                                                        </div>
                                                        <span style="margin-left: 5%;color: black;">
                                                            {{ value.deptName }}
                                                        </span>
                                                        &nbsp;&nbsp;&nbsp;({{ value.deptCount }})
                                                        <span style="float: right;margin-right: 20px;">
                                                            ＞
                                                        </span>
                                                    </div>
                                                    <!-- 展示部门和人数end -->
                                                    <br>
                                                    <!-- 展示当前所选部门的所有用户start -->
                                                    <div v-if="users.length!=0">
                                                        <el-checkbox-group v-model="childHeadIds"  @change="childHeadUser()">
                                                            <div class="architecture" style="height: 50px;"  v-for="(myUser,userIndex) in users" :key="userIndex"   >
                                                                <el-checkbox style="width: 80%;height: 100%;" :label="myUser.id">
                                                                    &nbsp;&nbsp;&nbsp;
                                                                    <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="myUser.icon"/>
                                                                    <span style="margin-left: 5%;color: black;font-size: 10px;float: left;position: relative;top: 12px;left: 110px;">
                                                                        {{ myUser.nickName }}<br>
                                                                        {{ myUser.tposition.deptName }}
                                                                    </span>
                                                                    <span style="margin-top: 25px;margin-left: 120px;">
                                                                        ＞
                                                                    </span>
                                                                </el-checkbox>
                                                            </div>
                                                        </el-checkbox-group>
                                                    </div>
                                                    <!-- 展示当前所选部门的所有用户start -->
                                                    <!-- 展示左边信息end -->

                                                </div>

                                                                                            
                                            </el-breadcrumb>

                                            <!-- 竖直分割线 -->
                                            <div class="myHr"></div>
                                        </div>
                                        <span slot="footer" class="dialog-footer">
                                            <el-button @click="childHeadPage = false">取 消</el-button>
                                            <el-button type="primary" @click="childHeadPage = false">确 定</el-button>

                                        </span>

                                    </el-dialog>

                                <!-- 选择负责人end -->
                                <br>
                        </div>
                        <div class="kuang"></div>
                        <span style=" padding-left:40px;" >考勤时间</span>
                        <div class="xian"></div>
                        <br>
                        <div style="margin-left: 40px;">
                            考勤时间
                            <br>
                            <br>
                            <el-radio v-model="attendance.clockSet.attendanceType" :label="0" @change="restClocks">固定班次</el-radio>
                            <br>
                            <span style="font-size: 12px;margin-left: 20px;color: #989DAA;">考勤组内每位人员的上下班时间一致</span>
                            <br>
                            <br>
                            <el-radio v-model="attendance.clockSet.attendanceType" :label="1">排班制</el-radio>
                            <br>
                            <span style="font-size: 12px;margin-left: 20px;color: #989DAA;">自定义每个人的班次</span>
                            <br>
                            <br>
                            <el-radio v-model="attendance.clockSet.attendanceType" :label="2" @change="restClocks">自由班制</el-radio>
                            <br>
                            <span style="font-size: 12px;margin-left: 20px;color: #989DAA;">不设置班次，可随时打卡</span>
                            <br>
                            <div v-if="attendance.clockSet.attendanceType==0">
                                <br>
                                班次设置
                                <br>
                                快捷设置班次：<el-tag type="info" style="border: none;">{{ shiftEntity.shiftName }}: {{ shiftEntity.startTime }}~{{ shiftEntity.endTime }}</el-tag> 
                                <el-button type="text" @click="shiftPage = true">&nbsp;&nbsp;&nbsp;更改班次</el-button>
                                <el-dialog
                                title="选择班次"
                                :visible.sync="shiftPage"
                                width="30%">
                                    
                                    <el-table
                                        :data="shifts"
                                        border
                                        style="width: 100%"
                                        :header-cell-style="{backgroundColor:'#F4F4F4'}">
                                        <el-table-column
                                        width="50">
                                            <template slot-scope="scope">
                                                <span>
                                                    <el-radio v-model="shiftEntity.id" :label="scope.row.id" @change="selectedShiftEntity(scope.row)">{{''}}</el-radio>
                                                </span>
                                            </template>
                                        </el-table-column>
                                        <el-table-column
                                        prop="shiftName"
                                        label="班次名称">
                                        </el-table-column>
                                        <el-table-column
                                        label="班次时间段">
                                            <template slot-scope="scope">
                                                <span>
                                                    {{ scope.row.commuteSchedulePO.startTime }} ~ {{ scope.row.commuteSchedulePO.endTime }}
                                                </span>
                                            </template>
                                        </el-table-column>
                                    </el-table>
                                    <br>
                                    <el-pagination
                                    @size-change="shiftSizeChange"
                                    @current-change="shiftNumChange"
                                    :page-sizes="[3, 100, 200, 300]"
                                    :page-size="shiftSize"
                                    layout="total, sizes, prev, pager, next, jumper"
                                    :total="shiftTotal"
                                    style="text-align:center;">
                                    </el-pagination>

                                    <span slot="footer" class="dialog-footer">
                                        <el-button @click="shiftPage = false">取 消</el-button>
                                        <el-button type="primary" @click="shiftPage = false">确 定</el-button>
                                    </span>
                                </el-dialog>
                                <br>
                                <br>
                                <el-table
                                    :data="days"
                                    ref="daysTable"
                                    border
                                    style="width: 50%"
                                    :header-cell-style="{backgroundColor:'#F4F4F4'}"
                                    @selection-change="selectedDay">
                                    <el-table-column
                                    type="selection"
                                    width="50">
                                    </el-table-column>
                                    <el-table-column
                                    prop="name"
                                    label="班次名称"
                                    width="100">
                                    </el-table-column>
                                    <el-table-column
                                    label="班次时间段">
                                        <template slot-scope="scope">
                                            <span v-if="scope.row.shiftEntity=='休息' || def == -1">休息</span>
                                            <span v-if="def == 0" style="color:#66b1ff">{{scope.row.shiftEntity.shiftName}}:&nbsp;&nbsp;&nbsp;{{scope.row.shiftEntity.startTime}}~{{scope.row.shiftEntity.endTime}}</span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                    label="操作"
                                    width="100">
                                        <template slot-scope="scope">
                                            <span>
                                                <el-button type="text" @click="upShift(scope.row)" :disabled="scope.row.shiftEntity=='休息'" >&nbsp;&nbsp;&nbsp;更改班次</el-button>
                                            </span>
                                        </template>
                                    </el-table-column>
                                </el-table>
                                

                                
                            </div>
                            <div v-if="attendance.clockSet.attendanceType==1">
                                <br>
                                末排班打卡规则
                                <br>
                                <br>
                                <el-radio v-model="attendance.clockSet.scheduledBreaks" :label="0">末排班员工不可打卡</el-radio>
                                <br>
                                <br>
                                <el-radio v-model="attendance.clockSet.scheduledBreaks" :label="1">员工可打卡，无需选班次</el-radio>
                                <br>
                                <br>
                                <el-radio v-model="attendance.clockSet.scheduledBreaks" :label="2">员工可打卡，需要先选班次</el-radio>
                                <br>
                            </div>
                            <div v-if="attendance.clockSet.attendanceType==2">
                                <br>
                                工作日
                                <br>
                                <br>
                                <el-checkbox-group v-model="attendance.clockSet.days">
                                    <el-checkbox label="周一"></el-checkbox>
                                    <el-checkbox label="周二"></el-checkbox>
                                    <el-checkbox label="周三"></el-checkbox>
                                    <el-checkbox label="周四"></el-checkbox>
                                    <el-checkbox label="周五"></el-checkbox>
                                    <el-checkbox label="周六"></el-checkbox>
                                    <el-checkbox label="周日"></el-checkbox>
                                </el-checkbox-group>
                            </div>
                            <div v-if="attendance.clockSet.attendanceType==0 || attendance.clockSet.attendanceType==2">
                                <br>
                                <el-checkbox v-model="attendance.clockSet.scheduledBreaks">法定节假日自动排休</el-checkbox>
                                <br>
                                <br>
                                <div v-if="attendance.clockSet.attendanceType==2">
                                    工作时长
                                    <br>
                                    <br>
                                    <el-input-number v-model="attendance.clockSet.hour" style="width: 100px;" controls-position="right" :min="1" :max="100" :controls="false" ></el-input-number> 小时
                                </div>
                                <br>
                                <br>
                                特殊日期
                                <br>
                                <br>
                                <el-button icon="el-icon-plus" plain @click="clockPage=true">新增必须打卡日期</el-button>
                                <br>
                                <br>
                                <el-table
                                    :data="clocks"
                                    border
                                    style="width: 50%"
                                    :header-cell-style="{backgroundColor:'#F4F4F4'}">
                                    <el-table-column
                                    prop="day"
                                    label="日期"
                                    width="170">
                                    </el-table-column>
                                    <el-table-column
                                    label="考勤班次">
                                        <template slot-scope="scope">
                                            <span>{{ scope.row.shiftEntity.shiftName }}: {{scope.row.shiftEntity.startTime}}~{{scope.row.shiftEntity.endTime}}</span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                    label="操作"
                                    width="170">
                                        <template slot-scope="scope">
                                            <span>
                                                <el-button type="text" @click="upClock(scope.row)">编辑</el-button>
                                                <el-button type="text" @click="delClock(scope.row.index)">删除</el-button>

                                            </span>
                                        </template>
                                    </el-table-column>
                                </el-table>
                                <el-dialog
                                title="必须打卡的日期"
                                :visible.sync="clockPage"
                                width="30%">
                                    选择日期
                                    <br>
                                    <br>
                                    <el-date-picker
                                    v-model="clockEntity.day"
                                    type="date"
                                    placeholder="选择日期"
                                    value-format="yyyy-MM-dd">
                                    </el-date-picker>
                                    <br>
                                    <br>
                                    <el-table
                                        :data="shifts"
                                        border
                                        style="width: 100%"
                                        :header-cell-style="{backgroundColor:'#F4F4F4'}">
                                        <el-table-column
                                        width="50">
                                            <template slot-scope="scope">
                                                <span>
                                                    <el-radio v-model="clockShiftEntityId" :label="scope.row.id" @change="selectedClock(scope.row)">{{''}}</el-radio>
                                                </span>
                                            </template>
                                        </el-table-column>
                                        <el-table-column
                                        prop="shiftName"
                                        label="班次名称">
                                        </el-table-column>
                                        <el-table-column
                                        label="班次时间段">
                                            <template slot-scope="scope">
                                                <span>
                                                  {{ scope.row.commuteSchedulePO.startTime }} ~ {{ scope.row.commuteSchedulePO.endTime }}
                                                </span>
                                            </template>
                                        </el-table-column>
                                    </el-table>
                                    <br>
                                    <el-pagination
                                    @size-change="shiftSizeChange"
                                    @current-change="shiftNumChange"
                                    :page-sizes="[3, 100, 200, 300]"
                                    :page-size="shiftSize"
                                    layout="total, sizes, prev, pager, next, jumper"
                                    :total="shiftTotal"
                                    style="text-align:center;">
                                    </el-pagination>

                                    <span slot="footer" class="dialog-footer">
                                        <el-button @click="clockPage = false">取 消</el-button>
                                        <el-button type="primary" @click="addClock">确 定</el-button>
                                    </span>
                                </el-dialog>

                                <br>
                                <br>
                                <el-button icon="el-icon-plus" plain @click="unClockPage=true">新增无需打卡日期</el-button>
                                <br>
                                <br>
                                <el-table
                                    :data="unClocks"
                                    border
                                    style="width: 50%"
                                    :header-cell-style="{backgroundColor:'#F4F4F4'}">
                                    <el-table-column
                                    prop="day"
                                    label="日期"
                                    width="170">
                                    </el-table-column>
                                    <el-table-column
                                    label="考勤班次">
                                        <template slot-scope="scope">
                                            <span>{{ scope.row.shiftEntity.shiftName }}: {{scope.row.shiftEntity.startTime}}~{{scope.row.shiftEntity.endTime}}</span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                    label="操作"
                                    width="170">
                                        <template slot-scope="scope">
                                            <span>
                                                <el-button type="text" @click="upUnClock(scope.row)">编辑</el-button>
                                                <el-button type="text" @click="delUnClock(scope.row.index)">删除</el-button>

                                            </span>
                                        </template>
                                    </el-table-column>
                                </el-table>
                                <el-dialog
                                title="必须打卡的日期"
                                :visible.sync="unClockPage"
                                width="30%">
                                    选择日期
                                    <br>
                                    <br>
                                    <el-date-picker
                                    v-model="unClockEntity.day"
                                    type="date"
                                    placeholder="选择日期"
                                    value-format="yyyy-MM-dd">
                                    </el-date-picker>
                                    <br>
                                    <br>
                                    <el-table
                                        :data="shifts"
                                        border
                                        style="width: 100%"
                                        :header-cell-style="{backgroundColor:'#F4F4F4'}">
                                        <el-table-column
                                        width="50">
                                            <template slot-scope="scope">
                                                <span>
                                                    <el-radio v-model="unClockShiftEntityId" :label="scope.row.id" @change="selectedUnClock(scope.row)">{{''}}</el-radio>
                                                </span>
                                            </template>
                                        </el-table-column>
                                        <el-table-column
                                        prop="shiftName"
                                        label="班次名称">
                                        </el-table-column>
                                        <el-table-column
                                        label="班次时间段">
                                            <template slot-scope="scope">
                                                <span>
                                                  {{ scope.row.commuteSchedulePO.startTime }} ~ {{ scope.row.commuteSchedulePO.endTime }}
                                                </span>
                                            </template>
                                        </el-table-column>
                                    </el-table>
                                    <br>
                                    <el-pagination
                                    @size-change="shiftSizeChange"
                                    @current-change="shiftNumChange"
                                    :page-sizes="[3, 100, 200, 300]"
                                    :page-size="shiftSize"
                                    layout="total, sizes, prev, pager, next, jumper"
                                    :total="shiftTotal"
                                    style="text-align:center;">
                                    </el-pagination>

                                    <span slot="footer" class="dialog-footer">
                                        <el-button @click="unClockPage = false">取 消</el-button>
                                        <el-button type="primary" @click="addUnClock">确 定</el-button>
                                    </span>
                                </el-dialog>
                            </div>
                            
                        </div>

                        <div class="kuang"></div>
                        <span style=" padding-left:40px;" >打卡方式</span>
                        <div class="xian"></div>
                        <div style="margin-left: 40px;">
                            <br>
                            <el-checkbox v-model="attendance.clockAddressStatus" label="0">位置打卡</el-checkbox>
                            <br>
                            <br>
                            <el-button icon="el-icon-plus" plain @click="clockAddrPage = true" :disabled="!attendance.clockAddressStatus">新增打卡地点</el-button>
                            <br>
                            <br>
                            <el-table
                                :data="clockAddresse"
                                border
                                style="width: 50%"
                                :header-cell-style="{backgroundColor:'#F4F4F4'}">
                                <el-table-column
                                prop="address"
                                label="考勤地点">
                                </el-table-column>
                                <el-table-column
                                label="有效范围(米)">
                                    <template slot-scope="scope">
                                        <el-input v-model="scope.row.size" placeholder="请输入内容"></el-input>
                                    </template>
                                </el-table-column>
                                <el-table-column
                                label="操作">
                                    <template slot-scope="scope">
                                        <span>
                                            <el-button type="text" @click="delClockAddress(scope.row.index)">删除</el-button>
                                        </span>
                                    </template>
                                </el-table-column>
                            </el-table>
                            <el-dialog
                            title="打卡地点"
                            :visible.sync="clockAddrPage"
                            width="80%">
                                <map-container style="width: 100%;" ref="map" @updateLocation="updateLocation" :lat="lat" :lng="lng" v-on:addressContent='addressContent'></map-container>
                                <span slot="footer" class="dialog-footer">
                                    <el-button @click="clockAddrPage = false">取 消</el-button>
                                    <el-button type="primary" @click="addAddress">确 定</el-button>
                                </span>
                            </el-dialog>

                            <br>
                            <el-checkbox v-model="attendance.clockWifiAddressStatus" label="0">Wi-Fi打卡</el-checkbox>
                            <br>
                            <br>
                            <el-button icon="el-icon-plus" plain @click="clockWiFiAddressePage = true" :disabled="!attendance.clockWifiAddressStatus">新增打卡Wi-Fi</el-button>
                            <br>
                            <br>
                            <el-table
                                :data="wifis"
                                border
                                style="width: 50%"
                                :header-cell-style="{backgroundColor:'#F4F4F4'}">
                                <el-table-column
                                prop="name"
                                label="Wi-Fi名">
                                </el-table-column>
                                <el-table-column
                                prop="ip"
                                label="MAC地址">
                                </el-table-column>
                                <el-table-column
                                label="操作">
                                    <template slot-scope="scope">
                                        <span>
                                            <el-button type="text" @click="delWiFi(scope.row.index)">删除</el-button>
                                        </span>
                                    </template>
                                </el-table-column>
                            </el-table>
                            <el-dialog
                            title="添加Wi-Fi"
                            :visible.sync="clockWiFiAddressePage"
                            width="30%">
                            <el-form :inline="true" :model="wifi" class="demo-form-inline">
                                <el-form-item label="Wi-Fi名称">
                                    <el-input v-model="wifi.name" placeholder="请选择名称"></el-input>
                                </el-form-item>
                                <br>
                                <el-form-item label="MAC地址">
                                    <el-input v-model="wifi.ip" placeholder="请输入MAC地址"></el-input>
                                </el-form-item>
                            </el-form>
                                <span slot="footer" class="dialog-footer">
                                    <el-button @click="clockWiFiAddressePage = false">取 消</el-button>
                                    <el-button type="primary" @click="addWifi">确 定</el-button>
                                </span>
                            </el-dialog>

                            
                        </div>
                        <div class="kuang"></div>
                        <span style=" padding-left:40px;" >加班规则</span>
                        <div class="xian"></div>
                        <div style="margin-left: 40px;">
                            <br>
                            <br>
                            <el-button plain @click="overtimePage = true" >设置加班规则</el-button>
                            <br>
                            <br>
                            
                            <el-table
                            :data="overtime"
                            border
                            style="width: 50%;"
                            :header-cell-style="{backgroundColor:'#F4F4F4'}">
                                <el-table-column
                                    prop="overtimeName"
                                    label="规则名称">
                                </el-table-column>
                                <el-table-column
                                label="规则内容"
                                width="400px">
                                    <template slot-scope="scope">
                                        <span>
                                            工作日:
                                            <span v-if="scope.row.week==undefined">
                                                禁止加班
                                            </span>
                                            <span v-else>
                                                <span v-if="scope.row.week.approval==1">
                                                    加班无需审批，
                                                </span>
                                                <span v-else>
                                                    加班必须审批，
                                                </span>
                                                <span v-if="scope.row.week.overtimeClock==1">
                                                    根据审批时间为准
                                                </span>
                                                <span v-else>
                                                    根据打卡时间为准
                                                </span>
                                            </span>
                                            
                                            <br>
                                            休息日:
                                            <span v-if="scope.row.rest==undefined">
                                                禁止加班
                                            </span>
                                            <span v-else>
                                                <span v-if=" scope.row.rest.approval==1">
                                                    加班无需审批，
                                                </span>
                                                <span v-else>
                                                    加班必须审批，
                                                </span>
                                                <span v-if="scope.row.rest.overtimeClock==1">
                                                    根据审批时间为准
                                                </span>
                                                <span v-else>
                                                    根据打卡时间为准
                                                </span>
                                            </span>
                                            <br>
                                            节假日:
                                            <span v-if="scope.row.holi==undefined">
                                                禁止加班
                                            </span>
                                            <span v-else>
                                                <span v-if="scope.row.holi.approval==1">
                                                    加班无需审批，
                                                </span>
                                                <span v-else>
                                                    加班必须审批，
                                                </span>
                                                <span v-if="scope.row.holi.overtimeClock==1">
                                                    根据审批时间为准
                                                </span>
                                                <span v-else>
                                                    根据打卡时间为准
                                                </span>
                                            </span>
                                        </span>
                                    </template>
                                </el-table-column>

                                <el-table-column
                                    label="操作">
                                    <template slot-scope="scope">
                                    <el-button type="text" @click="upOvertimeData(scope.row.id)">编辑</el-button>
                                    </template>
                                </el-table-column>

                            </el-table>

                            <el-dialog
                            title="选择加班规则"
                            :visible.sync="overtimePage"
                            width="80%">
                                <div class="grid-content bg-purple-dark">
                                    <router-link to="/OvertimeAdd"><el-button type="primary"  style="margin: 20px;">新建加班规则</el-button></router-link>
                                    <div style="margin: 20px;width: 400px;float: right;">
                                        <el-input placeholder="请输入内容" v-model="overtimeName" class="input-with-select">
                                            <el-button slot="append" icon="el-icon-search" @click="getReplacementCards()"></el-button>
                                        </el-input>
                                    </div>
                                </div>

                                <el-table
                                :data="overtimes"
                                border
                                style="width: 95%;margin: auto;"
                                :header-cell-style="{backgroundColor:'#F4F4F4'}">
                                    <el-table-column
                                        width="100">
                                        <template slot-scope="scope">
                                            <el-radio v-model="attendance.overtimeId" :label="scope.row.id">{{''}}</el-radio>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                        prop="overtimeName"
                                        label="规则名称">
                                    </el-table-column>
                                    <el-table-column
                                    label="规则内容"
                                    width="400px">
                                        <template slot-scope="scope">
                                            <span>
                                                工作日:
                                                <span v-if="scope.row.week==undefined">
                                                    禁止加班
                                                </span>
                                                <span v-else>
                                                    <span v-if="scope.row.week.approval==1">
                                                        加班无需审批，
                                                    </span>
                                                    <span v-else>
                                                        加班必须审批，
                                                    </span>
                                                    <span v-if="scope.row.week.overtimeClock==1">
                                                        根据审批时间为准
                                                    </span>
                                                    <span v-else>
                                                        根据打卡时间为准
                                                    </span>
                                                </span>
                                                
                                                <br>
                                                休息日:
                                                <span v-if="scope.row.rest==undefined">
                                                    禁止加班
                                                </span>
                                                <span v-else>
                                                    <span v-if=" scope.row.rest.approval==1">
                                                        加班无需审批，
                                                    </span>
                                                    <span v-else>
                                                        加班必须审批，
                                                    </span>
                                                    <span v-if="scope.row.rest.overtimeClock==1">
                                                        根据审批时间为准
                                                    </span>
                                                    <span v-else>
                                                        根据打卡时间为准
                                                    </span>
                                                </span>
                                                <br>
                                                节假日:
                                                <span v-if="scope.row.holi==undefined">
                                                    禁止加班
                                                </span>
                                                <span v-else>
                                                    <span v-if="scope.row.holi.approval==1">
                                                        加班无需审批，
                                                    </span>
                                                    <span v-else>
                                                        加班必须审批，
                                                    </span>
                                                    <span v-if="scope.row.holi.overtimeClock==1">
                                                        根据审批时间为准
                                                    </span>
                                                    <span v-else>
                                                        根据打卡时间为准
                                                    </span>
                                                </span>
                                            </span>
                                        </template>
                                    </el-table-column>

                                    <el-table-column
                                        label="操作">
                                        <template slot-scope="scope">
                                        <el-button type="text" @click="upOvertimeData(scope.row.id)">编辑</el-button>
                                        </template>
                                    </el-table-column>

                                </el-table>

                                <br>
                                <el-pagination
                                @size-change="overtimeHandleSizeChange"
                                @current-change="overtimeHandleCurrentChange"
                                :current-page="overtimePageNum"
                                :page-sizes="[3, 100, 200, 400]"
                                :page-size="overtimePageSize"
                                layout="total, sizes, prev, pager, next, jumper"
                                :total="overtimeTotal"
                                style="margin-left: 750px;">
                                </el-pagination>


                                <span slot="footer" class="dialog-footer">
                                    <el-button @click="overtimePage = false">取 消</el-button>
                                    <el-button type="primary" @click="addOvertime">确 定</el-button>
                                </span>
                            </el-dialog>
                            
                        </div>

                        <div class="kuang"></div>
                        <span style=" padding-left:40px;" >外勤打卡规则</span>
                        <div class="xian"></div>
                        <div style="margin-left: 40px;">
                            <br>
                            允许外勤打卡
                             <el-switch
                                v-model="attendance.fieldClock"
                                :active-value="0"
                                :inactive-value="1">
                            </el-switch>
                            <br>
                            <br>
                            <el-checkbox-group :disabled="attendance.fieldClock!=0" v-model="fieldClockRemark">
                                <el-checkbox  label="0">外勤打卡需要审批</el-checkbox>
                                <br>
                                <el-checkbox style="padding-top: 10px;" label="1">外勤打卡需要填写备注</el-checkbox>
                                <br>
                                <el-checkbox style="padding-top: 10px;" label="2">外勤打卡需要拍照</el-checkbox>
                                <br>
                                <el-checkbox style="padding-top: 10px;" label="3">允许员工隐藏详细地址</el-checkbox>
                            </el-checkbox-group>
                            <br>
                            <br>
                            允许地点微调
                             <el-switch
                                v-model="attendance.fieldClockAddress"
                                :active-value="0"
                                :inactive-value="1">
                            </el-switch>
                            <br>
                            <br>
                            微调范围&nbsp;&nbsp;&nbsp;
                            <el-select style="width: 100px;" :disabled="attendance.fieldClockAddress!=0" v-model="attendance.address" placeholder="请选择">
                                <el-option
                                v-for="item in sizes"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </div>

                        <div class="kuang"></div>
                        <span style=" padding-left:40px;" >补卡规则</span>
                        <div class="xian"></div>
                        <div style="padding-left: 40px;">
                            <br>
                            <br>
                            <el-button plain @click="cardPage = true" >设置补卡规则</el-button>
                            <br>
                            <br>
                            
                            <el-table
                                :data="replacementCard"
                                border
                                style="width: 50%;"
                                :header-cell-style="{backgroundColor:'#F4F4F4'}">
                                <el-table-column
                                    prop="rulesName"
                                    label="规则名称">
                                </el-table-column>
                                <el-table-column
                                    label="规则内容"
                                    width="400px">
                                    <template slot-scope="scope">
                                    补卡次数：每个月可提交{{ scope.row.replacementCount }}次，每月的1日起算;<br>
                                    补卡时限：可申请最近{{ scope.row.time }}个自然日内的补卡;<br>
                                    补卡类型：
                                    <span v-for="(value,index) in scope.row.replacementType" :key="index">
                                        <span v-if="value==0">
                                        缺卡、
                                        </span>
                                        <span v-if="value==1">
                                        迟到、
                                        </span>
                                        <span v-if="value==2">
                                        早退、
                                        </span>
                                        <span v-if="value==3">
                                        正常、
                                        </span>
                                    </span>
                                    </template>
                                </el-table-column>
                                <el-table-column
                                    label="应用范围">
                                    <template slot-scope="scope">
                                    <span v-if="scope.row.replacementApplyId==0">
                                        全公司
                                    </span>
                                    <span v-else>
                                        {{ scope.row.replacementApply.label }}
                                    </span>
                                    </template>

                                </el-table-column>
                                <el-table-column
                                    label="操作">
                                    <template slot-scope="scope">
                                    <el-button type="text" @click="upCardData(scope.row.id)">编辑</el-button>
                                    </template>
                                </el-table-column>

                            </el-table>
                            <br>

                            <el-dialog
                            title="选择加班规则"
                            :visible.sync="cardPage"
                            width="80%">
                                <div class="grid-content bg-purple-dark">
                                    <router-link to="/replacementCardAdd"><el-button type="primary"  style="margin: 20px;">新建补卡规则</el-button></router-link>
                                    <div style="margin: 20px;width: 400px;float: right;">
                                        <el-input placeholder="请输入内容" v-model="cardName" class="input-with-select">
                                            <el-button slot="append" icon="el-icon-search" @click="mySearch()"></el-button>
                                        </el-input>
                                    </div>
                                </div>

                                <el-table
                                :data="replacementCards"
                                border
                                style="width: 95%;margin: auto;"
                                :header-cell-style="{backgroundColor:'#F4F4F4'}">
                                    <el-table-column
                                        width="100">
                                        <template slot-scope="scope">
                                            <el-radio v-model="attendance.replacementCardId" :label="scope.row.id">{{''}}</el-radio>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                        prop="rulesName"
                                        label="规则名称">
                                    </el-table-column>
                                    <el-table-column
                                        label="规则内容"
                                        width="400px">
                                        <template slot-scope="scope">
                                        补卡次数：每个月可提交{{ scope.row.replacementCount }}次，每月的1日起算;<br>
                                        补卡时限：可申请最近{{ scope.row.time }}个自然日内的补卡;<br>
                                        补卡类型：
                                        <span v-for="(value,index) in scope.row.replacementType" :key="index">
                                            <span v-if="value==0">
                                            缺卡、
                                            </span>
                                            <span v-if="value==1">
                                            迟到、
                                            </span>
                                            <span v-if="value==2">
                                            早退、
                                            </span>
                                            <span v-if="value==3">
                                            正常、
                                            </span>
                                        </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                        label="应用范围">
                                        <template slot-scope="scope">
                                        <span v-if="scope.row.replacementApplyId==0">
                                            全公司
                                        </span>
                                        <span v-else>
                                            {{ scope.row.replacementApply.label }}
                                        </span>
                                        </template>

                                    </el-table-column>
                                    <el-table-column
                                        label="操作">
                                        <template slot-scope="scope">
                                        <el-button type="text" @click="upCardData(scope.row.id)">编辑</el-button>
                                        </template>
                                    </el-table-column>

                                </el-table>
                                <br>

                                <el-pagination
                                @size-change="cardHandleSizeChange"
                                @current-change="cardHandleCurrentChange"
                                :current-page="cardPageNum"
                                :page-sizes="[3, 100, 200, 400]"
                                :page-size="cardPageSize"
                                layout="total, sizes, prev, pager, next, jumper"
                                :total="cardTotal"
                                style="margin-left: 750px;">
                                </el-pagination>
                                

                                <span slot="footer" class="dialog-footer">
                                    <el-button @click="cardPage = false">取 消</el-button>
                                    <el-button type="primary" @click="addCard">确 定</el-button>
                                </span>
                            </el-dialog>
                        </div>

                        <br>

                        <el-form-item>
                            <el-button @click="resetForm('attendance')" style="width: 127px;height: 36px;">取消</el-button>
                            <el-button type="primary" @click="submitForm('attendance')" style="width: 127px;height: 36px;">
                                提交<br><br>
                            </el-button>
                        </el-form-item>
                        <br><br><br>
                    </div>
                    <!-- 新增补卡end -->
                </el-col>
            </el-row>
        </el-form>
    </div>
  
</template>

<script>
import axios from 'axios'
import { parseTime } from '@/utils/ruoyi';
import MapContainer from '@/components/MapContainer/MapContainer.vue'
export default {
    name:"ExaminationGroupAdd",
    components:{
        MapContainer   
    },
    data(){
        return{
            // 登录成功跳转页面加载
            go:false,
            attendance:{
                clockSet:{
                    attendanceType:0,
                    days:[],
                    scheduledBreaks:false,
                },
                fieldClock:1,
                clockAddressStatus:false,

            },
            rules: {
                attendanceName: [
                    { required: true, message: '请输入考情组名称', trigger: 'blur' }
                ]
            },

            // 获取考勤组人员start
            // 参与考勤
            headPage:false,//开启选择参与考勤页面
            headNavs:["组织架构"],//步骤条(通用)
            persons:[],//部门和部门人数(通用)
            users:[],//所选部门的人员(通用)
            loading:false,//加载开启和关闭(通用)
            selectIds:[],//多选参与考勤
            selectedUsers:[],//参与考勤选中的用户
            // 无需考勤
            unSelectIdPage:false,//开启选择无需考勤页面
            unSelectIds:[],//多选无需考勤
            unSelectedUsers:[],//无需考勤选中的用户

            // 获取考勤组人员end
            // 获取考勤组负责人start
            hostHeadPage:false,//开启选择主负责人页面
            selectArchitectureCss:-1,//选中指定行后开启指定的css
            hostHeadId:-1,//单选主负责人
            hostSelectedUser:"",//主负责人选中的用户

            // 子负责人
            childHeadPage:false,//开启选择子负责人页面
            childHeadIds:[],//多选子负责人
            childHeadUsers:[],//子负责人选中的用户
            // 获取考勤组负责人end

            // 考勤类型start

            // 选择的班次
            shiftPage:false,//打开选择班次的页面
            shifts:[],//所有班次信息
            shiftEntity:"",//选中的班次
            shiftSize:3,//页大小
            shiftNum:1,//当前页
            shiftTotal:0,//一共有几条
            days:[
                {name:"周一",shiftEntity:"休息",commuteSchedulePO:{}},
                {name:"周二",shiftEntity:"休息",commuteSchedulePO:{}},
                {name:"周三",shiftEntity:"休息",commuteSchedulePO:{}},
                {name:"周四",shiftEntity:"休息",commuteSchedulePO:{}},
                {name:"周五",shiftEntity:"休息",commuteSchedulePO:{}},
                {name:"周六",shiftEntity:"休息",commuteSchedulePO:{}},
                {name:"周日",shiftEntity:"休息",commuteSchedulePO:{}}
            ],
            selectedDays:[], 
            old:[],
            def:-1,//判断是否全没选

            clocks:[],//选择的打卡考勤班次
            clockPage:false,//页面展示·选择的打卡考勤班次
            clockShiftEntityId:"",//选择的打卡日期的班次Id
            clockEntity:{index:-1,day:"",shiftEntity:""},//打卡对象


            unClocks:[],//选择的打卡考勤班次
            unClockPage:false,//页面展示·选择的打卡考勤班次
            unClockShiftEntityId:"",//选择的打卡日期的班次Id
            unClockEntity:{index:-1,day:"",shiftEntity:""},//打卡对象
            // 考勤类型end
            // 打卡方式start
            // 打卡地点
            clockAddrPage:false,
            lat:34.346408,
            lng:108.79227,
            clockAddresse:[],
            clockAddress:{},

            // 打卡wifi
            clockWiFiAddressePage:false,
            wifi:{},//wifi的新增
            wifis:[],//wifi的全部
            // 打卡方式end

            // 加班规则start
            
            overtimePageNum:1,
            overtimePageSize:3,
            overtimeTotal:0,
            overtimes:[],//查询全部弹窗显示
            overtime:[],//前端展示
            overtimeName:"",//条查
            overtimePage:false,//弹窗确定
            
            // 加班规则end

            // 外勤打卡规则start

            fieldClockRemark:[],

            // 微调选择器
            sizes: [{
                value: '100',
                label: '100'
            }, {
                value: '200',
                label: '200'
            }, {
                value: '500',
                label: '500'
            }, {
                value: '1000',
                label: '1000'
            }, {
                value: '2000',
                label: '2000'
            }],

            // 外勤打卡规则end

            // 补卡规则start
            cardPage:false,
            replacementCards:[],//所有的补卡规则(弹窗的显示)
            replacementCard:[],//展示的补卡规则
            cardPageNum:1,//补卡页当前页
            cardPageSize:3,//补卡页大小
            cardTotal:0,//补卡条数
            cardName:"",//条差
            // 补卡规则end

        } 
    },
    created(){
        this.getDept();//获取部门
        this.getShifts();//获取班次
        this.getReplacementCards();// 获取加班信息;
        this.getCards();//获取补卡信息;
    },
    mounted(){
        let id = this.$route.params.id;
        if(id != undefined){
            this.getAttendance(id);
        }
    },
    methods: {
        updateLocation(addr){
            console.log(addr)
        },
        // 提交事务
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    this.go = true;
                    if(this.attendance.clockSet.attendanceType==0 || this.attendance.clockSet.attendanceType==2){
                        this.attendance.clockSet.days = this.attendance.clockSet.days.toString();
                        if(this.clocks!=""){
                            this.attendance.clockSet.addHaveToClock = [];
                            for (const val of this.clocks) {
                                this.attendance.clockSet.addHaveToClock.push(val.day+","+val.shiftEntity.id);
                                console.log(val);
                            }
                            this.attendance.clockSet.addHaveToClock =  this.attendance.clockSet.addHaveToClock.toString();
                        }
                        if(this.unClocks!=""){
                            this.attendance.clockSet.addNoClock = [];
                            for (const val of this.unClocks) {
                                this.attendance.clockSet.addNoClock.push(val.day+","+val.shiftEntity.id);
                            }
                            this.attendance.clockSet.addNoClock = this.attendance.clockSet.addNoClock.toString();
                        }
                    }
                    if(this.attendance.clockSet.attendanceType==1){
                        this.attendance.clockSet.days = "";
                        this.attendance.clockSet.addHaveToClock = undefined;
                        this.attendance.clockSet.addNoClock = undefined;
                    }
                    if(this.attendance.fieldClock==0){
                        this.attendance.fieldClockRemark = this.fieldClockRemark.toString();
                    }
                    
                    // 判断赋值
                    if(this.attendance.clockAddressStatus){
                        this.attendance.clockAddressStatus = 0; 
                        this.attendance.addressContent = [];
                        for (const val of this.clockAddresse) {
                            this.attendance.addressContent.push(val.address+","+val.size);
                        }
                        this.attendance.addressContent = this.attendance.addressContent.toString();

                    }else{
                        this.attendance.clockAddressStatus = 1;
                    }
                    
                    if(this.attendance.clockWifiAddressStatus){
                        this.attendance.clockWifiAddressStatus = 0;
                        this.attendance.wifiContent = [];
                        for (const val of this.wifis) {
                            this.attendance.wifiContent.push(val.name+","+val.ip);
                        }
                        this.attendance.wifiContent = this.attendance.wifiContent.toString();
                    }else{
                        this.attendance.clockWifiAddressStatus = 1;
                    }
                    console.log(this.attendance)
                    axios.post("/user/findUserByToken")
                    .then((res)=>{
                        if(this.attendance.i==null){
                            this.attendance.createdBy = res.data;
                        }else{
                            this.attendance.updateBy = res.data;
                        }
                        axios.post("/AttendanceGroup/addOrUpAttendance",this.attendance)
                        .then((res)=>{
                            console.log(res)
                            if(res.data==1){
                                this.$message({
                                    message:"操作成功!!!",
                                    type:"success"
                                });
                                setTimeout(()=>{
                                    res.data = -1;
                                    this.$router.go(-1);
                                },3000);
                            }
                        })
                    })
                    
                } 
            });
        },
        // 重置事务
        resetForm(formName) {
            this.$router.go(-1);
        },
        // 考勤人员start
        // 更新步骤条
        upNav(index){
            this.headNavs = this.headNavs.slice(0,index+1);
            if("组织架构"==this.headNavs){
                this.loading = true;
                this.users = [];
                this.getDept();
            }
        },
        // 获取部门及部门人数
        getDept(){
            this.selectId=-1;
            axios.post("/ReplacementCard/findDept")
            .then((res)=>{
                this.persons = res.data.rows;
                this.loading = false;
            })
        },
        // 获取所选择部门的用户信息
        selectArchitecture(value){
            this.loading = true;
            this.persons = [];
            this.headNavs.push(value);
            var data = new FormData();
            data.append("name",value)
            axios.post("/ReplacementCard/findUserAndDept",data)
            .then((res)=>{
                this.users = res.data.rows;
                
                if(this.headPage){
                    for (const i in this.users) {
                        for (const val of this.unSelectedUsers) {
                            if(this.users[i].id == val.id){
                                this.users.splice(i,1);
                            }
                        }
                    }
                }
                
                if(this.unSelectIdPage){
                    for (const i in this.users) {
                        for (const val of this.selectedUsers) {
                            if(this.users[i].id == val.id){
                                this.users.splice(i,1);
                            }
                        }
                    }
                }

                if(this.hostHeadPage){
                    for (const i in this.users) {
                        for (const val of this.childHeadUsers) {
                            if(this.users[i].id == val.id){
                                this.users.splice(i,1);
                            }
                        }
                    }
                }

                if(this.childHeadPage){
                    for (const i in this.users) {
                        if(this.hostSelectedUser!="" && this.users[i].id == this.hostSelectedUser.id){
                            this.users.splice(i,1);
                        }
                    }
                }

                if(this.users!=[]){
                    this.loading = false;
                }

            })

        },
        // 参与考勤选中用户
        selectUser(){
            // this.selectedUser = this.users[index];
            if(this.selectedUsers.length>=3){
                this.selectedUsers = [];
                this.selectIds = [];
                this.$message({
                    type:"warning",
                    message:"最多只能选择三个"
                })
            }else{
                this.attendance.onAttendance = this.selectIds.toString();
                for (const val of this.users) {
                    for (const id of this.selectIds) {
                        if(val.id==id){
                            if(this.selectedUsers.length==0){
                                this.selectedUsers.push(val);
                            }else{
                                let count = 0;
                                for (let i in this.selectedUsers) {
                                    if(this.selectedUsers[i].id==id){
                                        count++;
                                    }
                                    if(i==this.selectedUsers.length-1 && count==0){
                                        this.selectedUsers.push(val);
                                    }
                                }
                            }
                        }
                    }
                }
            }
           
            
        },
        // 删除用户
        deUser(index){
            this.selectIds.splice(index,1);
            let array = this.attendance.onAttendance.split(",");
            for (let val in array) {
                if(array[val]==this.selectedUsers[index].id){
                    array.splice(val,1);
                }
            }
            this.attendance.onAttendance = array.toString();
            this.selectedUsers.splice(index,1);

        },

        getSelectIdPage(){
            this.users = [];
            this.headPage = true;
            this.headNavs = ["组织架构"];
            this.getDept();
        },

        // 无需考勤用户
        unSelectUser(){
            if(this.unSelectedUsers.length>=3){
                this.unSelectedUsers = [];
                this.unSelectIds = [];
                this.$message({
                    type:"warning",
                    message:"最多只能选择三个"
                })
            }else{
                this.attendance.unAttendance = this.unSelectIds.toString();
                for (const val of this.users) {
                    for (const id of this.unSelectIds) {
                        if(val.id==id){
                            if(this.unSelectedUsers.length==0){
                                this.unSelectedUsers.push(val);
                            }else{
                                let count = 0;
                                for (let i in this.unSelectedUsers) {
                                    if(this.unSelectedUsers[i].id==id){
                                        count++;
                                    }
                                    if(i==this.unSelectedUsers.length-1 && count==0){
                                        this.unSelectedUsers.push(val);
                                    }
                                }
                            }
                        }
                    }
                }
            }
           
            
        },
        // 删除
        unDeUser(index){
            this.unSelectIds.splice(index,1);
            
            let array = this.attendance.unAttendance.split(",");
            for (let val in array) {
                if(array[val]==this.unSelectedUsers[index].id){
                    array.splice(val,1);
                }
            }
            this.attendance.unAttendance = array.toString();
            this.unSelectedUsers.splice(index,1);

        },
        // 获取部门信息
        getUnSelectIdPage(){
            this.users = [];
            this.unSelectIdPage = true;
            this.headNavs = ["组织架构"];
            this.getDept();
        },

        
        // 考勤人员end
        
        // 考勤负责人start
        // 主负责人
        // 单选Nav重置
        // 更新步骤条
        upRadNav(index){
            this.headNavs = this.headNavs.slice(0,index+1);
            if("组织架构"==this.headNavs){
                this.loading = true;
                this.users = [];
                this.hostDeUser();
                this.getDept();
            }
        },
        hostSelectUser(index){
            this.selectArchitectureCss = index;
            this.hostSelectedUser = this.users[index];
            this.attendance.hostHead = this.hostSelectedUser.id;
        },
        // 删除用户
        hostDeUser(){
            this.hostHeadId=-1;
            this.hostSelectedUser="";
            this.selectArchitectureCss = -1;
            this.attendance.hostHead = "";
        },
        // 获取部门信息
        getHostHeadPage(){
            this.hostHeadPage = true;
            for (const i in this.users) {
                for (const val of this.childHeadUsers) {
                    if(this.users[i].id == val.id){
                        this.users.splice(i,1);
                    }
                }
            }
        },

        // 子负责人
        childHeadUser(){
            if(this.childHeadUsers.length>=3){
                this.childHeadUsers = [];
                this.childHeadIds = [];
                this.$message({
                    type:"warning",
                    message:"最多只能选择三个"
                })
            }else{
                this.attendance.childHead = this.childHeadIds.toString();
                this.childHeadUsers = [];
                for (const val of this.users) {
                    for (const id of this.childHeadIds) {
                        if(val.id==id){
                            if(this.childHeadUsers.length==0){
                                this.childHeadUsers.push(val);
                            }else{
                                let count = 0;
                                for (let i in this.childHeadUsers) {
                                    if(this.childHeadUsers[i].id==id){
                                        count++;
                                    }
                                    if(i==this.childHeadUsers.length-1 && count==0){
                                        this.childHeadUsers.push(val);
                                    }
                                }
                            }
                        }
                    }
                }
            }
           
            
        },
        // 删除用户
        childHeadDeUser(index){
            this.childHeadIds.splice(index,1);
            let array = this.attendance.childHead.split(",");
            for (let val in array) {
                if(array[val]==this.childHeadUsers[index].id){
                    array.splice(val,1);
                }
            }
            this.attendance.childHead = array.toString();
            this.childHeadUsers.splice(index,1);
        },
        getchildHeadPage(){
            this.users = [];
            this.childHeadPage = true;
            this.headNavs = ["组织架构"];
            this.getDept();
        },
        // 考勤负责人end
        // 获取班次设置start
        getShifts(){
            axios.post("/shift/findAll?pageSize="+this.shiftSize+"&pageNum="+this.shiftNum,{})
            .then((res)=>{
                this.shifts = res.data.data.rows;
                if(this.shiftEntity==""){
                    this.shiftEntity = res.data.data.rows[0];
                    this.shiftEntity.startTime = this.shiftEntity.commuteSchedulePO.startTime;
                    this.shiftEntity.endTime = this.shiftEntity.commuteSchedulePO.endTime;
                }
                
                this.shiftTotal = res.data.data.total;
                this.newShifts = this.shifts;
            })
        },

        shiftSizeChange(val){
            this.shiftSize = val;
            this.getShifts();//获取班次
        },

        shiftNumChange(val){
            this.shiftNum = val;
            this.getShifts();//获取班次
        },

        selectedShiftEntity(value){
            this.getShifts();//这里的目的是因为选择后会更改id重置
            this.shiftEntity = value;
            this.shiftEntity.startTime = this.shiftEntity.commuteSchedulePO.startTime;
            this.shiftEntity.endTime = this.shiftEntity.commuteSchedulePO.endTime;
        },

        
        selectedDay(value){
            this.selectedDays = [];
            let newArray = [];
            for (const val of value) {
                let count = 0;
                for (const ol of this.old) {
                    if(val.name==ol.name){
                        count++;
                        break;
                    }
                }
                if(count!=1){
                    newArray.push(val);
                    this.def = 0;
                }
            }
            let del = "";
            for (const ol of this.old) {
                let count = 0;
                for (const val of value) {
                    if(val.name == ol.name){
                        count++;
                        break;
                    }    
                }
                if(count==0){
                    del = ol.name;
                }
            }
            
            for (const val of this.days) {
                if(val.name == del){
                    val.shiftEntity = "休息";
                    for (const va in this.attendance.clockSet.days) {
                        if(this.attendance.clockSet.days[va].split(",")[0]==del){
                            this.attendance.clockSet.days.splice(va,1);
                        }
                    }
                }
                
            }
            this.old = value;
            for (let val of value) {
                for (const newVal of newArray) {
                    if(newVal.name==val.name){
                        val.shiftEntity = this.shiftEntity;
                        this.def = 0;
                        this.attendance.clockSet.days.push(val.name+","+this.shiftEntity.id);
                        
                        // this.selectedDays.push(this.shiftEntity);
                    }
                }
            }
            if(value==""){
                this.def = -1;
                this.days=[
                    {name:"周一",shiftEntity:"休息"},
                    {name:"周二",shiftEntity:"休息"},
                    {name:"周三",shiftEntity:"休息"},
                    {name:"周四",shiftEntity:"休息"},
                    {name:"周五",shiftEntity:"休息"},
                    {name:"周六",shiftEntity:"休息"},
                    {name:"周日",shiftEntity:"休息"}
                ]
                this.attendance.clockSet.days = [];
            }else{
                this.def = 0;
            }
            
            
        },
        
        upShift(val){
            for (const value of this.days) {
                if(value.name == val.name){
                    value.shiftEntity = this.shiftEntity;
                }
                for (const key in this.attendance.clockSet.days) {
                    if(this.attendance.clockSet.days[key].split(",")[0] == val.name){
                        this.attendance.clockSet.days[key] = val.name+","+this.shiftEntity.id;
                        console.log(this.attendance.clockSet.days[key]);
                        this.attendance.clockSet.days.splice(parseInt(key)+1,1);
                    }
                }
            }
            
        },
        // 新增必须打卡日期
        selectedClock(value){
            value.startTime = value.commuteSchedulePO.startTime;
            value.endTime = value.commuteSchedulePO.endTime;
            this.clockEntity.shiftEntity = value;
        },

        addClock(){
            if(this.clocks==""){
                this.clocks.push({index:0,day:this.clockEntity.day,shiftEntity:this.clockEntity.shiftEntity});
            }else{
                console.log(this.clockEntity)
                if(this.clockEntity.index!=-1){
                    for (const value of this.clocks) {
                        if(value.index==this.clockEntity.index){
                            value.day = this.clockEntity.day;
                            value.shiftEntity = this.clockEntity.shiftEntity;
                            this.clockEntity = {index:-1};
                        }
                    }
                }else{
                    this.clocks.push({index:(this.clocks[this.clocks.length-1].index)+1,day:this.clockEntity.day,shiftEntity:this.clockEntity.shiftEntity});
                }
            }
            if(this.clockDate != ""){
                this.clockPage = false;
            }else{
                this.$message({
                    message:"日期必选",
                    type:"error",
                })
            }

        },
        upClock(value){
            this.clockEntity = value;
            this.clockPage = true;
        },
        delClock(value){
            for (const val in this.clocks) {
                if(this.clocks[val].index == value){
                    this.clocks.splice(val,1);
                }
            }
        },



        // 新增无需打卡日期
        selectedUnClock(value){
            value.startTime = value.commuteSchedulePO.startTime;
            value.endTime = value.commuteSchedulePO.endTime;
            this.unClockEntity.shiftEntity = value;
        },

        addUnClock(){
            if(this.unClocks==""){
                this.unClocks.push({index:0,day:this.unClockEntity.day,shiftEntity:this.unClockEntity.shiftEntity});
            }else{
                if(this.unClockEntity.index!=-1){
                    for (const value of this.unClocks) {
                        if(value.index==this.unClockEntity.index){
                            value.day = this.unClockEntity.day;
                            value.shiftEntity = this.unClockEntity.shiftEntity;
                            this.unClockEntity = {index:-1};
                        }
                    }
                }else{
                    this.unClocks.push({index:(this.unClocks[this.unClocks.length-1].index)+1,day:this.unClockEntity.day,shiftEntity:this.unClockEntity.shiftEntity});
                }
            }
            if(this.unClockDate != ""){
                this.unClockPage = false;
            }else{
                this.$message({
                    message:"日期必选",
                    type:"error",
                })
            }

        },
        upUnClock(value){
            this.clockEntity = value;
            this.clockPage = true;
        },
        delUnClock(value){
            for (const val in this.clocks) {
                if(this.clocks[val].index == value){
                    this.clocks.splice(val,1);
                }
            }
        },
        
        // 获取班次设置end
        // 切换考勤时间重置
        restClocks(){
            this.attendance.clockSet.days=[];
        },
        // 打卡方式start
        // 新增打卡地点

        // 接收子类穿过来的参数
        addressContent:function(value){
            this.lat = value.lat;
            this.lng = value.lng;
            this.clockAddress = {address:value.name,size:value.size,ip:value.lat+","+value.lng};
        },
        addAddress(){
            if(this.clockAddresse==""){
                this.clockAddresse.push({index:0,address:this.clockAddress.address,size:this.clockAddress.size,ip:this.clockAddress.ip});
            }else{
                this.clockAddresse.push({index:this.clockAddresse[this.clockAddresse.length-1].index+1,address:this.clockAddress.address,size:this.clockAddress.size,ip:this.clockAddress.ip});
            }
            this.clockAddrPage =false;
        },

        delClockAddress(value){
            for (const val in this.clockAddresse) {
                if(this.clockAddresse[val].index == value){
                    this.clockAddresse.splice(val,1);
                }
            }
        },
        addWifi(){
            if(this.wifis==""){
                this.wifi.index = 0;
            }else{
                this.wifi.index = this.wifis[this.wifis.length-1].index+1;
            }
            this.wifis.push(this.wifi);
            this.clockWiFiAddressePage = false;
            this.wifi = {};
        },
        delWiFi(index){
            for (const val in this.wifis) {
                if(this.wifis[val].index == index){
                    this.wifis.splice(val,1)
                }
            }
        },
        
        
        // 打卡方式end
        // 加班规则start

        getReplacementCards(){
          // 获取加班信息
          axios.post("/overtime/findAllOvertime?"+"pageSize="+this.overtimePageSize+"&pageNum="+this.overtimePageNum,{overtimeName:this.overtimeName})
          .then((res)=>{
            this.overtimes = res.data.rows; 
            this.overtimeTotal = res.data.total;
          })
        
        }, 
        overtimeHandleSizeChange(val) {
          this.overtimePageSize = val;
          console.log(`每页 ${val} 条`);
          this.getReplacementCards();
        },
        overtimeHandleCurrentChange(val) {
          this.overtimePageNum = val;
          console.log(`当前页: ${val}`);
          this.getReplacementCards();
        },

        // 跳转到修改班次
        upOvertimeData(overtimeId){
            this.$router.push({name:"overtimeAdd",params:{id:overtimeId}});
        },
        // 确定加班规则
        addOvertime(){
            this.overtime = [];
            for (const val of this.overtimes) {
                if(val.id == this.attendance.overtimeId){
                    this.overtime.push(val);
                }
            }
            this.overtimePage = false;
        },

        // 加班规则end

        // 补卡规则start
        getCards(){
          // 获取补卡信息
          axios.post("/ReplacementCard/findAllReplacementCard?rulesName="+this.cardName+"&pageSize="+this.cardPageSize+"&pageNum="+this.cardPageNum)
          .then((res)=>{
            this.replacementCards = res.data.rows; 
            this.cardTotal = res.data.total;
          })
        }, 
        cardHandleSizeChange(val) {
            
            this.cardPageSize = val;
            console.log(`每页 ${val} 条`);
            this.getCards();
        },
        cardHandleCurrentChange(val) {
            this.cardPageNum = val;
            console.log(`当前页: ${val}`);
            this.getCards();
        },
        addCard(){
            this.replacementCard = [];
            for (const val of this.replacementCards) {
                if(val.id == this.attendance.replacementCardId){
                    this.replacementCard.push(val);
                }
            }
            this.cardPage = false;
        },
        upCardData(replacementCardId){
            this.$router.push({name:"replacementCardAdd",params:{id:replacementCardId}});
        },
        // 补卡规则end

        // 获取指考勤组信息
        getAttendance(id){
            this.go = true;
            this.go = false;
            let data = new FormData();
            data.append("id",id);
            axios.post("/AttendanceGroup/findOneAttendance",data)
            .then((res)=>{
                this.go = true;
                // 回显设置
                this.attendance = res.data;
                // 参与考勤回显
                let onAttendance = this.attendance.onAttendance.split(",");
                for (const val of onAttendance) {
                    axios.post("/demo/findOneUser?id="+val)
                    .then((res)=>{
                        this.selectedUsers.push(res.data);
                    })
                }
                // 无需考勤回显
                let unAttendance = this.attendance.unAttendance.split(",");
                for (const val of unAttendance) {
                    axios.post("/demo/findOneUser?id="+val)
                    .then((res)=>{
                        this.unSelectedUsers.push(res.data);
                    })
                }
                // 主负责人回显
                axios.post("/demo/findOneUser?id="+this.attendance.hostHead)
                .then((res)=>{
                    this.hostSelectedUser = res.data;
                })
                
                // 子负责人回显
                let childHead = this.attendance.childHead.split(",");
                for (const val of childHead) {
                    axios.post("/demo/findOneUser?id="+val)
                    .then((res)=>{
                        this.childHeadUsers.push(res.data);
                    })
                }
                if(this.attendance.clockSet.attendanceType==0 || this.attendance.clockSet.attendanceType==2){
                    this.attendance.clockSet.days = this.attendance.clockSet.days.split(",");
                    if(this.attendance.clockSet.attendanceType==0){
                        for (const val in this.attendance.clockSet.days) {
                            if(val%2==0){
                                for (const day of this.days) {
                                    if(day.name == this.attendance.clockSet.days[val]){
                                        this.$nextTick( ()=>{
                                            this.$refs.daysTable.toggleRowSelection(day,true);
                                        })
                                        axios.post("/shift/findOneShiftBO?id="+this.attendance.clockSet.days[parseInt(val)+1])
                                        .then((res)=>{
                                            day.shiftEntity = res.data;
                                            day.shiftEntity.startTime = day.shiftEntity.commuteScheduleBO[0].startTime; 
                                            day.shiftEntity.endTime = day.shiftEntity.commuteScheduleBO[0].endTime;
                                            let num = [];
                                            for (const key in this.attendance.clockSet.days) {
                                                if (this.attendance.clockSet.days[key].length>2) {
                                                    num.push(key);
                                                }
                                            }
                                            for (const val of num) {
                                                this.attendance.clockSet.days.splice(val,1);
                                            }
                                        })
                                    }
                                }
                                
                            }
                            
                        }
                    }
                    // 新增必须打卡
                    this.attendance.clockSet.addHaveToClock = this.attendance.clockSet.addHaveToClock.split(",");
                    for (const key in this.attendance.clockSet.addHaveToClock) {
                        if(key%2==0){
                            axios.post("/shift/findOneShiftBO?id="+this.attendance.clockSet.addHaveToClock[parseInt(key)+1])
                            .then((res)=>{
                                let myShiftEntity = res.data;
                                myShiftEntity.startTime = myShiftEntity.commuteScheduleBO[0].startTime; 
                                myShiftEntity.endTime = myShiftEntity.commuteScheduleBO[0].endTime; 
                                this.clocks.push({day:this.attendance.clockSet.addHaveToClock[key],shiftEntity:myShiftEntity})
                            })                                   
                        }
                    }
                    // 新增无需打卡
                    this.attendance.clockSet.addNoClock = this.attendance.clockSet.addNoClock.split(",");
                    for (const key in this.attendance.clockSet.addNoClock) {
                        if(key%2==0){
                            axios.post("/shift/findOneShiftBO?id="+this.attendance.clockSet.addNoClock[parseInt(key)+1])
                            .then((res)=>{
                                let myShiftEntity = res.data;
                                myShiftEntity.startTime = myShiftEntity.commuteScheduleBO[0].startTime; 
                                myShiftEntity.endTime = myShiftEntity.commuteScheduleBO[0].endTime; 
                                this.unClocks.push({day:this.attendance.clockSet.addNoClock[key],shiftEntity:myShiftEntity})
                            })                                   
                        }
                    }


                }
                this.attendance.clockSet.scheduledBreaks = JSON.parse(this.attendance.clockSet.scheduledBreaks);
                // 位置打卡
                if(this.attendance.clockAddressStatus == 0){
                    this.attendance.clockAddressStatus = true;
                }else{
                    this.attendance.clockAddressStatus = false;
                }
                
                this.attendance.addressContent = this.attendance.addressContent.split(","); 
                for (const val in this.attendance.addressContent) {
                    if(val%2==0){
                        this.clockAddresse.push({address:this.attendance.addressContent[val],size:this.attendance.addressContent[parseInt(val)+1]});
                    }
                }
                // Wifi打卡
                if(this.attendance.clockWifiAddressStatus == 0){
                    this.attendance.clockWifiAddressStatus = true;
                }else{
                    this.attendance.clockWifiAddressStatus = false;
                }
                this.attendance.wifiContent = this.attendance.wifiContent.split(","); 
                for (const val in this.attendance.wifiContent) {
                    if(val%2==0){
                        this.wifis.push({name:this.attendance.wifiContent[val],ip:this.attendance.wifiContent[parseInt(val)+1]});
                    }
                }

                // 加班规则
                axios.post("/overtime/findOvertimeOne?id="+this.attendance.overtimeId)
                .then((res)=>{
                    this.overtime.push(res.data.rows) ;
                })
                this.fieldClockRemark = this.attendance.fieldClockRemark.split(",");

                // 补卡规则
                axios.post("/ReplacementCard/findReplacementCard?id="+this.attendance.replacementCardId)
                .then((res)=>{
                    this.replacementCard.push(res.data) ;
                    this.go = false;
                })

            })
        },

        
    }
}
</script>

<style scoped>
    body {
        margin: 0;
    }
    .kuai{
        width:98%;
        /* border: 1px red solid; */
        position: relative;
        top: 30px;
        left: 55px;
    }
    .kuang{
        width: 3px;
        height: 20px;
        background-color: #409EFF;
        margin-left: 30px;
        position: relative;
        top: 23px;
    }
    .xian{
        width: 97.5%;
        height: 2px;
        background-color: #EBEEF5;
        margin-left: 40px;
        margin-top: 20px;
       
    }
    .el-row {
        margin-bottom: 20px;
    }
    .el-col {
        border-radius: 4px;
    }
    .bg-purple-dark {
        background: white;
    }
    .bg-purple {
        background: #d3dce6;
    }
    .bg-purple-light {
        background: #e5e9f2;
    }
    .grid-content {
        
        border-radius: 4px;
        min-height: 36px;
    }
    .row-bg {
        padding: 10px 0;
        background-color: #f9fafc;
    }


    .avatar-uploader-icon[data-v-e49b18d0]{
        border: 1px solid rgba(198, 201, 208, 1);
        background-color: rgba(248, 248, 248, 1);
        border-radius: 50%;
    }

    .avatar-uploader-icon {
        font-size: 20px;
        color: #8c939d;
        width: 50px;
        height: 50px;
        line-height: 50px;
        text-align: center;
    }

    /* 获取负责人start */
    .architecture{
        width: 271px;
        height: 39px;
        padding-left: 20px;
        border-radius: 5px;
    }
    .architecture:hover{
        background-color: #f8f8f8;
    }
    .architectureActe{
        width: 271px;
        height: 39px;
        line-height: 39px;
        padding-left: 20px;
        border-radius: 5px;
        background-color: rgba(231, 244, 255, 1);;
    }
    /* 竖着的水平线 */
    .myHr{
        border-left: 2px solid#989DAA;;
        height:100%;
        left: 48%;
        top: 0px;
        position: absolute;
    }

    .log{
        width: 27px;
        height: 27px;
        background-color: rgba(158, 208, 255, 1);
        float: left;
        position: relative;
        top: 15%;
        border-radius: 50%;
    }
    .log img{
        width: 13px;
        height: 13px;
        position: relative;
        bottom: 15%;
        left: 25%;
    }
    /* 获取负责人end */

    /* 设置工作日，休息日，节假日选中 */
    .el-menu--horizontal>.el-menu-item.is-active{
        color: rgb(24, 144, 255) !important;
    }

    .el-menu-demo{
        width: 97.5%;
    }
    /* 上班时间多选框背景颜色 */
    .input-with-select >>>.el-input-group__prepend {
        background-color: #fff;
    }
</style>